package com.Sumcc.utils.systemUtil;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesUtil {
    public static String getStorageAddress(){
        Properties properties = new Properties();
        InputStream resourceAsStream = PropertiesUtil.class.getResourceAsStream("/wyxt.properties");
        try {
            properties.load(resourceAsStream);
            return properties.getProperty("StorageAddress");
        }catch (IOException e){
            return "读取配置文件错误!";
        }
    }
    public static String getMaxfilesize(){
        Properties properties = new Properties();
        InputStream resourceAsStream = PropertiesUtil.class.getResourceAsStream("/wyxt.properties");
        try {
            properties.load(resourceAsStream);
            return properties.getProperty("maxfilesize");
        }catch (IOException e){
            return "读取配置文件错误!";
        }
    }
    public static String getMaxRequestfilesize(){
        Properties properties = new Properties();
        InputStream resourceAsStream = PropertiesUtil.class.getResourceAsStream("/wyxt.properties");
        try {
            properties.load(resourceAsStream);
            return properties.getProperty("maxRequestfilesize");
        }catch (IOException e){
            return "读取配置文件错误!";
        }
    }
}
